﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace MoneyManager
{
    static class CategoryManager
    {
        static public ObservableCollection<Category> Categories { get; private set; }

        static CategoryManager()
        {
            Categories = new ObservableCollection<Category>();
        }

        static public Category GetCategoryById(int id) 
        {
            foreach (Category c in Categories)
                if (c.Id == id) return c;
            return null;
        }

        static public void Add(Category category) 
        {
            Categories.Add(category);
        }

        static public void Remove(Category category)
        {
            Categories.Remove(category);
        }
    }
}
